<!DOCTYPE html>
<html>
<head>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title id="doctitle">topic</title>
    <meta name="author" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="Expires" content="-1">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta content="telephone=no" name="format-detection"/>
    <meta name="screen-orientation" content="portrait">
    <!-- uc强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <!-- Bootstrap -->
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/special.css">
    <link rel="stylesheet" href="css/mx-bubble.css" type="text/css" />
    <link rel="stylesheet" href="css/bubbles.css" type="text/css" />
    <!-- Bootstrap Js -->
    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="bootstrap/js/respond.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="js/echarts/echarts.js"></script>
    <script src="js/common.js"></script>
    <script src="json/specialTopic.js"></script>
    <script src="js/jquery-plugins/jquery.tmpl.min.js"></script>
    <script src="js/jquery-plugins/jquery.tmplPlus.min.js"></script>
    
    <!-- yuxi.file -->
    <link rel="stylesheet" type="text/css" href="css/yuxi.css">
    <script src="js/yuxi.js"></script>
    
    <script src="js/page.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/html2canvas.js"></script>
    <script type="text/javascript" src="js/basic.js"></script>
    <script type="text/javascript" src="js/jspdf.debug.js"></script>

    <style>
	.a div{padding:1.5% 0; padding-top:0;}
	</style>
    <script>
        $(function(){
        	//初始化page对象
			page.init();
        	
            $('.echart').eq(0).show().siblings('.echart').hide();
            initeChart();
        	initArticles();
        	//观点分析
        	requestOption(GetQueryString('id'));
        });
        
        
        function initArticles(){
        	var prefix = localStorage.localIP;
    		var url = "/inter/queryArticlesView";	
    		//if(!url.startsWith('/')){
    		//	prefix += '/';
    		//}
    		var sUrl = prefix + url + '.json';
            $.ajax({
                 url : sUrl,
                 type : "post",
                 dataType:'json',
                 data : {
                     id : GetQueryString('id'),
                     page : page.getPageCount(),
                     size : page.getSize()
                 },
                 success : function(data) {
                     if(data && data != ""){
                         var result =  eval('(' + data + ')');
                         if(result.error){
                             alert(result.error);
                         } else{
                             if(result.ret == 0) {
                                var list = result.data;
                                if(list && list.length > 0){
                                	var newsArr = new Array();
                                    var forumArr = new Array();
                                    var bloggerArr = new Array();
                                    var flatMediaArr = new Array();
                                    var twitterArr = new Array();
                                    var snsArr = new Array();
                                    var otherArr = new Array();
                                    
                                    list.forEach(function(obj){
                                    	if(obj.media_type == "新闻"){
                                    		newsArr.push(obj);
                                    	} else if(obj.media_type == "论坛"){
                                    		forumArr.push(obj);
                                    	} else if(obj.media_type == "博客"){
                                    		bloggerArr.push(obj);
                                    	} else if(obj.media_type == "平媒"){
                                    		flatMediaArr.push(obj);
                                    	} else if(obj.media_type == "Twitter"){
                                    		twitterArr.push(obj);
                                    	} else if(obj.media_type == "SNS"){
                                    		snsArr.push(obj);
                                    	} else if(obj.media_type == "其他"){
                                    		otherArr.push(obj);
                                    	}
                                    });
                                    
                                    if(newsArr && newsArr.length > 0){
                                    	$("<button>新闻</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(newsArr).appendTo('#newsList');
                                    }
                                    if(forumArr && forumArr.length > 0){
                                    	$("<button>论坛</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(forumArr).appendTo('#newsList');
                                    }
                                    if(bloggerArr && bloggerArr.length > 0){
                                    	$("<button>博客</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(bloggerArr).appendTo('#newsList');
                                    }
                                    if(flatMediaArr && flatMediaArr.length > 0){
                                    	$("<button>平媒</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(flatMediaArr).appendTo('#newsList');
                                    }
                                    if(twitterArr && twitterArr.length > 0){
                                    	$("<button>Twitter</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(twitterArr).appendTo('#newsList');
                                    }
                                    if(snsArr && snsArr.length > 0){
                                    	$("<button>SNS</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(snsArr).appendTo('#newsList');
                                    }
                                    if(otherArr && otherArr.length > 0){
                                    	$("<button>其他</button>").appendTo('#newsList');
                                    	$('#newsListTemplate').tmpl(otherArr).appendTo('#newsList');
                                    }
                                    
                                    //设置是否加载更多的状态，false为已经获取完毕，不需要再加载
        							page.setLoadMoreFlag(list.length);
        							if(!page.getLoadMoreFlag()){
        								$(".res_lod").css("display", "none");
        							}
                                } else{
                                	page.setLoadMoreFlag(0);
        							if(!page.getLoadMoreFlag()){
        								$(".res_lod").css("display", "none");
        							}
                                }
                   			}else{
                   				alert(result.msg);
                   			}
                         }
                     }
                    
                 },
                 error : function(XMLHttpRequest, textStatus, errorThrown) {
                      //alert('系统出现未知异常，请联系系统管理员！');
                 }
             });
            callbackevent();
        }
        
        function GetQueryString(name)
		{
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r!=null)return  unescape(r[2]); return null;
		}
        
        function hmProxy(url, data, callback){
	        var prefix = localStorage.localIP;
			//if(!url.startsWith('/')){
			//	prefix += '/';
			//}
        	$.ajax({
        		type: 'post',
        		url: prefix + url + '.json?message=' + JSON.stringify(data),
        		dataType: 'json',
        		success: callback
        	});
        }
        
        function requestTopicView(){
        	
        }
        
        function requestMediaCoverage(id){
        	var json = {
       			"id":id
       		};
        	
        	hmProxy('topic/mediaCoverage', json, function(data, textStatus, jqXHR){
        		data = eval("("+data+")");
        		if(data && data.ret == 0){
        			var list = data.data;
        			if(list && list.length > 0){
        				var names = new Array();
        				var datas = new Array();
        				list.forEach(function(obj){
        					names.push(obj.site_name);
        					datas.push(obj.quantity);
        				});
        				require(
                            [
                                'echarts',
                                'echarts/chart/bar'
                            ],
                            function (ec) {
                                var myChart = ec.init(document.getElementById('topicBar'));
                                var option = {
                            	    tooltip : {
                            	        trigger: 'axis',
                            	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                            	        }
                            	    },
                            	    legend: {
                            	        show : false,
                            	        data:['直接访问'],
                            	        padding:[25,0,0,0]
                            	    },
                            	    toolbox: {
                            	        show : false,
                            	        feature : {
                            	            mark : {show: true},
                            	            dataView : {show: true, readOnly: false},
                            	            magicType : {show: true, type: ['tiled']},
                            	            restore : {show: true},
                            	            saveAsImage : {show: true}
                            	        }
                            	    },
                            	    calculable : true,
                            	    grid:{
                            	        //show : false,
                            	        borderWidth: 0,
                            	    },
                            	    xAxis : [
                            	        {
                            	            show : false,
                            	            type : 'value'
                            	        }
                            	    ],
                            	    yAxis : [
                            	        {
                            	            show : true,
                            	            type : 'category',
                            	            data : names,
                            	            axisLine:{
                            	                show : false
                            	            },
                            	            axisLabel:{
                            	                show : true
                            	            },
                            	            splitLine:{
                            	                show : false
                            	            },
                            	            axisTick:{
                            	                show : false
                            	            }

                            	        }
                            	    ],
                            	    axis:{
                            	        axisLabel:{
                            	            show : true
                            	        }
                            	    },
                            	    series : [	
                            	        {
                            			    barWidth:25,
                            				barHeight:25,
                            	            name:'直接访问',
                            	            type:'bar',
                            	            stack: '总量',
                            	            itemStyle : {
                            					 normal:{
                            						 barBorderRadius:[0,40,40,0],
                            				         color: function(params) {
                            	                        var colorList = [
                            	                          '#a7c1e3','#a7c1e3','#568bce','#568bce','#5cce56',
                            	                          '#a7c1e3','#a7c1e3','#568bce','#568bce','#5cce56',
                            	                           //'#FE8463','#9BCA63','#FAD860','5cce56','#60C0DD',
                            	                           //'#D7504B','#C6E579','#F4E001','#F0805A','#5cce56'
                            	                        ];
                            	                        return colorList[params.dataIndex]
                            	                    },
                       	                    label : {show: true, position: 'insideLeft'}}},
                                            data:datas
                                        }
                                    ]
                                };
                                myChart.setOption(option);
                            }
                        );
        			}
        		}
        	});
        }
        
        function requestSide(id){
        	var json = {
        		"id":id
        	};
        	
        	hmProxy('topic/side', json, function(data, textStatus, jqXHR){
        		data = eval("("+data+")");
        		if(data && data.ret == 0){
        			var data = data.data;
        			if(data){
        				var names = new Array();
        				var datas = new Array();
        				names.push({"value":data.positive, "name" : ("Positive "+data.positiverate+"%")});
        				names.push({"value":data.negative, "name" : ("Negative "+data.negativerate+"%")});
        				datas.push({"value":data.positive, "name" : "Positive"});
        				datas.push({"value":data.negative, "name" : "Negative"});

        				 require(
                                 [
                                     'echarts',
                                     'echarts/chart/pie'
                                 ],
                                 function (ec) {
                                     var myChart = ec.init(document.getElementById('topicPie'));
                                     var option = {
                                             tooltip : {
                                                 trigger: 'item',
                                                 formatter: "{a} <br/>{b} : {c} ({d}%)"
                                             },
                                             calculable : false,
                                             series : [

                                                 {
                                                     name:'',
                                                     type:'pie',
                                                     selectedMode: 'single',
                                                     radius : [0, 90],

                                                     // for funnel
                                                     x: '20%',
                                                     width: '40%',
                                                     funnelAlign: 'right',
                                                     max: 1548,

                                                     itemStyle : {
                                                         normal : {
                                                             label : {
                                                                 position : 'inner'
                                                             },
                                                             labelLine : {
                                                                 show : false
                                                             }
                                                         }
                                                     },
                                                     data:names
                                                 },
                                                 {
                                                     name:'',
                                                     type:'pie',
                                                     clockWise:true,
                                                     radius : [100, 140],

                                                     // for funnel
                                                     x: '60%',
                                                     width: '35%',
                                                     funnelAlign: 'left',
                                                     max: 1048,

                                                     data:datas
                                                 }
                                             ]
                                         };
                                         myChart.setOption(option);
                                 }
                         );
        			}
        		}
        	});
        };
        
        function requestOption(id){
        	var json = {
        		"id":id
        	};
        	
        	hmProxy('topic/opinion', json, function(data, textStatus, jqXHR){
        		data = eval("("+data+")");
        		if(data && data.ret == 0){
        			var list = data.data;
        			if(list && list.length > 0){
        				var positive = new Array();
        				var negative = new Array();
        				list.forEach(function(obj){
        					//负面
        					if(obj.side == '-1'){
        						obj.side = '负面';
        						negative.push(obj);
        					}
        					//正面
        					else if(obj.side == '1'){
        						obj.side = '正面';
        						positive.push(obj);
        					}
        				});
        				var titleHtml = "";
        				if(positive.length > 0){
        					titleHtml = "<div class='xiguandian' style='font-size: 16px; font-weight: bold; color: blue;'>正面<div>";
        					$(titleHtml).appendTo('#topicPoints');
        					var count = 0;
        					positive.forEach(function(obj){
        						count++;
        						obj.index = count;
        						$('#topicPointsTemplate').tmpl(obj).appendTo('#topicPoints');
        					});
        				}
        				if(negative.length > 0){
        					titleHtml = "<div class='xiguandian' style='font-size: 16px; font-weight: bold; color: blue;'>负面<div>";
        					$(titleHtml).appendTo('#topicPoints');
        					var count = 0;
        					negative.forEach(function(obj){
        						count++;
        						obj.index = count;
        						$('#topicPointsTemplate').tmpl(obj).appendTo('#topicPoints');
        					});
        				}
        			}
        		}
        	});
        };
        
        function initeChart(){
        	require.config({
                paths: {
                    echarts: 'js/echarts'
                }
            });
        	
        	//TOP10
        	requestMediaCoverage(GetQueryString('id'));
        	//正负面
        	requestSide(GetQueryString('id'));
        }
		
      //页面转成pdf
	    function topdf(){
			$(".spac_footer").css("display", "none");
			event.preventDefault();  
            html2canvas(document.body, {  
                allowTaint: true,  
                taintTest: false,  
                onrendered: function(canvas) {  
                    canvas.id = "mycanvas"; 
                    var dataUrl = canvas.toDataURL('image/jpeg');
                    var doc = new jsPDF();
            		doc.addImage(dataUrl, 'JPEG', 30, 10, 160, 300);
            		doc.save('output.pdf');
            		$(".spac_footer").css("display", "");
                }  
            });
		}
    </script>
    <!--<script src="js/echarts/chart/ascatter.js" type="text/javascript" charset="utf-8"></script>-->
    <style>
        .a div{padding:1.5% 0; padding-top:0;}
    </style>
    <!--<script src="js/aline.js" type="text/javascript" charset="utf-8"></script>-->
</head>

<body >
<div class="zzc" style="display: none" ></div>
<div id="container" class="container" style="height:auto; padding:0;background:url(images/specialTopic/special_bg.png) no-repeat;">
    <!--<div class="row" style="border-bottom:1px solid #ddd; background:none; padding:0; padding-bottom:5%;" >
        <div class="col-xs-2" style=" width:13%; margin-right:13%;margin-top:3px;"><a href="index.html"><img src="images/gongyong_fh.png" /></a></div>

        <div class="col-xs-6" style="padding:0;"><a href="#" style="font-size:2.0rem;color:#fff;">Tesla is coming</a></div>

        <div id="indexTranButton" class="col-xs-2" style=" padding:0; width:9%; margin-right:3%"><img src="images/index_wz_ico3.png" /></div>
        <div class="col-xs-2" style=" padding:0; width:9%"><a href="searchOne.html"><img src="images/index_wz_ico4.png" /></a></div>
    </div>

    <p class="s_content">Tesla United States official website has a map of the world, in accordance with the five continents divided
        by three interfaces (no African and South America). As the source of the Tesla and the most concerned about
        the North American market, the </p>
    <div class="row sp_header" style="background:none; padding:0;" >
        <div class="col-xs-3 sp_active" style=" text-align:center" ><a href="#" >Rank</a></div>
        <div class="col-xs-5 " style=" text-align:center"> <a href="#">Info Analysis</a></div>
        <div class="col-xs-4" style=" text-align:center"><a href="#">Keywords</a></div>
    </div>-->
</div>


<div id="topicBar" class="echart" style="height:400px;"></div>
<div id="topicPie" class="echart" style="height:400px;"></div>
<!--  <div id="topicVenn"  class="echart" style=" width:94%; padding:3%;height:400px; margin:0 auto;"></div>-->
<div class="echart" style=" width:94%; padding:3%;height:400px; margin:0 auto;">
	<div id="bubbles" class="bubbles" style="height:400px;"></div>
</div>
<div id="topicPoints" class="echart">
  <script id="topicPointsTemplate" type="text/x-jquery-tmpl">
  <div class="xiguandian">
       <dl>
         <dd>${index}，${content}（${hot}）</dd>
       </dl>
  </div>
</script>
</div>
<!--第一个tab-->

<div class="index_list " style="background:#f8f8f8;width:100%;">
    <div id="newsList"></div>
    <div class="main_nr" style="padding-bottom:2em;">
  		<p class="res_lod" onclick="loadMore();" >Load more</p>
  	</div>
</div>

		<div  class="spac_footer">
			<a style="float:left;padding-left:20px;"><img src="images/specialTopic/spac_ico1.png"></a>
			<a href="#" style="text-align:center;"><img src="images/specialTopic/spac_ico2.png"></a>
			<a href="javascript:void(0);" style="float:right;padding-right:20px;" onclick="topdf();"><img src="images/specialTopic/spac_ico3.png"></a>
		</div>
		<div class="ximantansword">暂不提供人工翻译，如有需要请<br/>拨打我公司客服电话：4000000000<div class="arrow"></div></div>
		<div class="ximantansword2">Tap for human translation on this page<div class="arrow"></div></div>



<!--人工翻译弹出层
<div class="share2" style="display: none" >
    <p class="first_p">中文简体</p>
    <p class="second_p">中文繁体</p>
    <p class="third_p">English</p>
    <p class="four_p">French</p>
    <p class="cancel01">Cancle</p>
</div>
一-->
<!--人工翻译弹出层二-->
<div class="share3" style="display: none">
    <p class="first">180$</p>
    <p class="second">238 words this page for translating to English manually</p>
    <p class="cancel">Cancle</p>
    <p class="pay">Pay</p>
</div>

<!--分享弹出二-->
<div class="txqq" style="display: none">
    <p class="first_p">Share To</p>
    <dl>
        <dt>
            <img src="images/msg.png" alt="">
        <dt>
        <dd>
            Message
        </dd>
    </dl>
    <dl>
        <dt>
            <img src="images/qq.png" alt="">
        <dt>
        <dd>
            QQ
        </dd>
    </dl>
    <dl>
        <dt>
            <img src="images/wechat.png" alt="">
        <dt>
        <dd>
            WeChat
        </dd>
    </dl>
    <dl>
        <dt>
            <img src="images/weibo.png" alt="">
        <dt>
        <dd>
            MiniBlog
        </dd>
    </dl>
    <p class="close1">Close</p>

</div>
<!--分享弹出一-->
<div class="share1" style="display: none">
    <p class="first_p">Current news</p>
    <p class="second_p">All news in nailed list(7)</p>
    <p class="third_p">Cancel</p>
</div>
</body>
<script id="newsListTemplate" type="text/x-jquery-tmpl">
		<div class="margin_b">
			<h1 class="index_tit_b" onclick="window.location='information.html?topic_id=${topic_id}&uuid=${uuid}'">${title}</h1>
			<div>
				<span class="index_tit_s">${website_name}</span>
				<span class="sp_ico_r">
				<!--<a class="index_space_s xi_space_s1"><img src="images/gongyong_icon1.png" /></a>
				<a class="index_space_s xi_space_s2"><img src="images/gongyong_icon2.png" /></a>
				<a class="index_space_s xi_space_s3 fenxiang"><img src="images/gongyong_icon3.png" /></a>-->
				</span>
                <div class="clear"></div>
			</div>
		</div>
</script>
<script  id="top" type="text/x-jquery-tmpl">
    <div class="row" style= "padding:0; margin:0;border-bottom:1px solid rgba(255,255,255, .3); background:none; padding:3% 0; " >
            <div class="col-xs-2" style=" width:13.5%;padding-left: 4%;padding-top:1%"><a href="index.html" style="display:block; float:left; position:relative; width:68%; margin-left:4%; margin-top:11%;"><img src="images/gongyong_fh.png"  style="width:100%; " /></a></div>

    <div class="col-xs-6" style="padding:0; width:63%;text-align:center"><a href="#" style="font-size:2.0rem;color:#e3e5e6;text-align:center">${title}</a></div>

    <div id="indexTranButton" class="col-xs-2" style=" padding:0; width:9%; margin-right:2%; margin-top:1%"><img src="images/index_wz_ico3.png" style="width:80%" /></div>
    <div class="col-xs-2" style=" padding:0; width:9%; margin-right:1%;text-align:right;"><a href="searchOne.html"><img src="images/index_wz_ico4.png" style="width:80%"/></a></div>
    </div>

    <p class="s_content" style="padding:3%;">${abstractInfo}</p>
    <div class="row sp_header" style="background:none; padding:0;" >
            <div class="col-xs-3 sp_active" style=" padding:2% 1%; text-align:center;width:18%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" ><a href="#" >Rank</a></div>
    <div class="col-xs-5 " style="padding:2% 1%; text-align:center;width:29%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> <a href="#">Info Analysis</a></div>
    <div class="col-xs-4" style="padding:2% 1%; text-align:center;width:23%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"><a href="#">Keywords</a></div>
    <div class="col-xs-6" style="padding:2% 1%; text-align:center;width:30%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"><a href="#">Point Analysis</a></div>
    </div>
</script>
<script>
    function callbackevent(){
        //玉玺添加的js，
        // 1. 开始：3个小按钮的特效：集合、收藏、分享
        $(".xi_space_s1").click(function(){
            // $(".allmask").show();
            // $(".share1").show();
            if($(this).find("img").attr('src')=="images/gongyong_ico11.png"){
                $(this).find("img").attr("src","images/gongyong_icon1.png");
            }
            else{
                $(this).find("img").attr("src","images/gongyong_ico11.png");
            }
        });
        $(".third_p").click(function(){
            // $(".allmask").hide();
            // $(".share1").hide();
            $(this).find("img").attr("src","images/gongyong_ico1.png");
        });

        $(".xi_space_s2").click(function(){
            if($(this).find("img").attr('src')=="images/gongyong_ico22.png"){
                $(this).find("img").attr("src","images/gongyong_icon2.png");
            }
            else{
                $(this).find("img").attr("src","images/gongyong_ico22.png");
            }
        });

        $(".xi_space_s3").click(function(){
            $(".allmask").show();
            $(".share1").show();
            $(".circle").hide();
            if($(this).find("img").attr('src')=="images/gongyong_ico3.png"){
                $(this).find("img").attr("src","images/gongyong_icon3.png");
            }
            else{
                $(this).find("img").attr("src","images/gongyong_ico3.png");
            }
        });
        $(".third_p").click(function(){
            $(".allmask").hide();
            $(".share1").hide();
            $(".circle").show();
            $(this).find("img").attr("src","images/gongyong_icon3.png");
        });

        $(".first_p").click(function(){
            $(".allmask").show();
            $(".txqq").show();
            $(".share1").hide();
        });
        $(".close1").click(function(){
            $(".allmask").hide();
            $(".txqq").hide();
        });

        $(".second_p").click(function(){
            $(".allmask").show();
            $(".txqq").show();
            $(".share1").hide();
        });
        $(".close1").click(function(){
            $(".allmask").hide();
            $(".txqq").hide();
        });

        //1. 结束：3个小按钮的特效：集合、收藏、分享

        $(".head03").click(function(){
            $(".xifanyizhong").show();
        });
        $(".index_list ").click(function(){
            $(".xifanyizhong").hide();
        });

        $(".margin_b").click(function(){
            $(this).addClass("active");
        });
        $(".margin_b").mouseout(function(){
            $(this).removeClass("active");
        });

    }
    //function loadNewsList(url){
       //requestData(url ? url : 'json/indexNewsList.json', function(data, textStatus, jqXHR){
            //if(data && data.code == 0){
                //$('#newsListTemplate').tmpl(data.data).appendTo('#newsList');
            //}else{
                // TODO
            //}
            //callbackevent();
        //});
    //}
    function loadTop(url){
    	var prefix = localStorage.localIP;
		var url = "/inter/querySubjectList";	
		//if(!url.startsWith('/')){
		//	prefix += '/';
		//}
		var sUrl = prefix + url + '.json';
        $.ajax({
             url : sUrl,
             type : "post",
             dataType:'json',
             data : {
                 id : GetQueryString('id')
             },
             success : function(data) {
                 if(data && data != ""){
                     var result =  eval('(' + data + ')');
                     if(result.error){
                         alert(result.error);
                     } else{
                         if(result.ret == 0) {
                            var list = result.data;
                            for(var i = 0; i < list.length; i++){
                				var obj = list[i];
                		        //for(var e in obj){
                		        	//var o = obj[e];
                		        	//if(o.id == GetQueryString('id')){
	                				var title = obj.title;
	        		        		var len = 10;
	    		        			if(title && title.length > len){
	    		        				title = title.substring(0,len);
	    		        				var reg = /^0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z$/;
	    		        				var arr = title.split("");
	    		        				if(arr){
	    		        					var count = 0;
	    		        					arr.forEach(function(val){
	    		        						if(reg.test(val)){
	    		        							count++;
	    		        						}
	    		        					});
	    		        				}
	    		        				len = len + count;
	    		        				if(obj.title.length > len){
	    		        					title = obj.title.substring(0,len) + "...";
	    		        				} else{
	    		        					title = obj.title;
	    		        				}
	    		        			}
	    		        			obj.title = title;
                		        		$('#top').tmpl(obj).appendTo('#container'); 		            	
                		        	//}
                		        	//}
                		        }
                			}else{
                				alert(result.msg);
                			}
                     }
                 }
                 $('.sp_header div').click(function(){
     	            //$('.index_list').eq($(this).index()).show().siblings('.index_list').hide()
     	            $('.echart').eq($(this).index()).show().siblings('.echart').hide();
     	            $(this).addClass('sp_active').siblings('div').removeClass('sp_active');
     	            initeChart();
     	        });
                 
                 var i=1;
                 $('#indexTranButton').click(function(){
                 //var ele = $(this).parents("#tranTxt");
                 //translate();
                 if(i%2 ==0){
                	transBtnClick('en','zh'); 
                 }else{
                   	transBtnClick('zh','en');
                 }
                 i++;
             	});
             },
             error : function(XMLHttpRequest, textStatus, errorThrown) {
                  //alert('系统出现未知异常，请联系系统管理员！');
             }
         });
    }
    function empty(){
        $('#newsList .xi_space_s1').each(function(i,item){
            var div = $(item);
            console.log(div);
            if(div.find("img").attr('src')=="images/gongyong_icon1.png"){
                console.log(div.parent().parent());
                div.parent().parent().parent().remove();
            }
        });
    }
    $(function(){
        //loadNewsList();
        loadTop();
        $('#indexTranButton').click(function(){
            $(".fanyi").show();
            setTimeout(function(){
                // TODO 为了演示，加入延时
                $('#newsList').empty();
                //empty();
                loadNewsList('json/indexNewsListChi.json');
                $('#container').empty();
                loadTop('json/topicTopChinese.json');
                $(".fanyi").hide();
            }, 1000);
        });
	  
       // setTimeout(function(){
        //}, 1000);
//        人工翻译，弹弹弹
        $('.spac_footer a').eq(0).click(function(){
            // $('.share2').show()
            // $('.zzc').show()
        })
        $('.share2 p').not('.cancel01').click(function(){
            $('.share3').show()
            $('.share2').hide()
        })
        $('.cancel').click(function(){
            $('.share3').hide()
            $('.zzc').hide()
        })
        $('.cancel01').click(function(){
            $('.share2').hide()
            $('.zzc').hide()
        })
//        分享，弹弹弹
		/*
        $('.spac_footer a').eq(2).click(function(){
           $('.share1,.zzc').show()
        })
        */

        $('.share1 p').not('.third_p').click(function(){
            $('.txqq').show()
            $('.share1').hide()

        })
        $('.share1 .third_p').click(function(){
            $('.share1,.zzc').hide()
        })
        $('.close1').click(function(){
            $('.txqq,.zzc').hide()

        })

    });
    
    function loadMore(){
		page.nextPage();
		initArticles();
	};
</script>
<!-- <script src="js/jsondata-scatter.js"></script>-->
<script src="js/myscatter.js"></script>
<script type="text/javascript" src="js/jsPDF/iframe.js"></script>
</html>